home *** CD-ROM | disk | FTP | other *** search
-
- TIME (and DATE too, but that name was taken...)
-
- ©1991 David Plummer.
-
- This program is freely distributable software, on the condition
- that the executable and documentation are distributed without
- modification, and all copyright notices are left intact. No
- charge may be made for distribution other than a nominal
- handling and duplication fee, plus handling costs. Express
- permission is granted to Fred Fish to distribute this program in
- his software library.
-
- All that for a time command?
-
- WHY A TIME COMMAND
- ~~~~~~~~~~~~~~~~~~
- 1> I needed one.
- 2> I was tired of writing new scripts like echo "$(date)" FIRST 18
- that quit working when I changed my shell weekly...
- 3> I wanted something highly configurable, that would print the
- time and date in any particular format I wanted.
-
- So here it is. TIME can print the time and date, as well as any
- extra text in the output string, in just about any format you
- could possibly imagine.
-
- For example: time -f "Today is %A, %B %d, %Y." gives...
-
- Today is Wednesday, October 09, 1991.
-
- Depending on what day it actually is, of course :-)
-
- The format specifiers are:
-
- ------------------------------------------------------------------------
- %a abbreviated weekday name %p locale's equivalent of AM or PM
- %A full weekday name %S second as a num (0-59)
- %b abbreviated month name %U week-of-year, Sun first (0-52)
- %B full month name %w weekday as a num (0-6, Sun is 0)
- %c standard date and time string %W week-of-year, Mon first (0-52)
- %d day-of-month as a num (1-31) %x standard date string
- %H hour (0-23) %X standard time string [default]
- %I hour (1-12) %y year as num w/o century (00-99)
- %j day-of-year as a num (1-366) %Y year as num w/ century
- %m month as a num (1-12) %Z timezone name
- %M minute as a num (0-59) %% the percent sign
- ------------------------------------------------------------------------
-
- [ You know, ANSI C has a function just like this, too bad my LATTICE
- compiler doesn't... then again, it doesn't have clock(), or mktime(),
- or difftime(), or strftime()... at least in my version... sigh. ]
-
-
- Anyway, have fun, or at least as much fun as you can have with a
- time command. If you have comments, suggestions, bug reports,
- or copious quantities of cash to send me, I can be reached at:
-
- plummer@hercules.cs.uregina.ca
-
- David Plummer
- 2326 Francis Street
- Regina, Saskacthewan
- S4N 2P7
- 1-306-352-0358
-
-